package com.beaven.imclient.adapter;

import android.support.annotation.LayoutRes;
import android.view.View;
import com.beaven.imclient.R;
import com.beaven.imclient.data.UserSelected;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

/**
 * author: Beaven
 * time: 2017/6/2 14:58
 *
 * 群成员选择Adapter
 */

public class MemberAdapter extends BaseQuickAdapter<UserSelected, BaseViewHolder> {

  public MemberAdapter(@LayoutRes int layoutResId) {
    super(layoutResId);
  }

  @Override protected void convert(BaseViewHolder helper, UserSelected item) {
    helper.setText(R.id.text_list_title, item.getUser().getName());
    helper.getView(R.id.image_category_select)
        .setVisibility(item.isSelected() ? View.VISIBLE : View.GONE);
  }
}
